package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreRoleTelUsesPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;


@Entity
@NamedQuery(name = "RimCoreRoleTelUses.findAll",     query = "select o from RimCoreRoleTelUses o")
@Table(name = "RIM_CORE_ROLE_TEL_USES")
@IdClass(RimCoreRoleTelUsesPK.class)
public class RimCoreRoleTelUses implements Serializable {
    
    @Id
    @Column(name="ROLE_ID", nullable = false, insertable = false, updatable = false)    private Long roleId;
    @Id
    @Column(name="ROLE_VERSION_NUM", nullable = false, insertable = false, updatable = false)    private Long roleVersionNum;
    @Id
    @Column(name="TEL_ADDRESS_ID", nullable = false, insertable = false, updatable = false)    private Long telAddressId;
    @Id
    @Column(name="USE_CODE", nullable = false)    private String useCode;
    
    @ManyToOne
    @JoinColumns({
    @JoinColumn(name = "ROLE_ID", referencedColumnName = "ROLE_ID"),
    @JoinColumn(name = "ROLE_VERSION_NUM", referencedColumnName = "ROLE_VERSION_NUM"),
    @JoinColumn(name = "TEL_ADDRESS_ID", referencedColumnName = "TEL_ADDRESS_ID")
    })
    private RimCoreRoleTelAddrs rimCoreRoleTelAddrs;

    public RimCoreRoleTelUses() {
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getRoleVersionNum() {
        return roleVersionNum;
    }

    public void setRoleVersionNum(Long roleVersionNum) {
        this.roleVersionNum = roleVersionNum;
    }

    public Long getTelAddressId() {
        return telAddressId;
    }

    public void setTelAddressId(Long telAddressId) {
        this.telAddressId = telAddressId;
    }

    public String getUseCode() {
        return useCode;
    }

    public void setUseCode(String useCode) {
        this.useCode = useCode;
    }

    public RimCoreRoleTelAddrs getRimCoreRoleTelAddrs() {
        return rimCoreRoleTelAddrs;
    }

    public void setRimCoreRoleTelAddrs(RimCoreRoleTelAddrs rimCoreRoleTelAddrs) {
        this.rimCoreRoleTelAddrs = rimCoreRoleTelAddrs;
    }
}
